#ifndef MOVINGOBJECT_H
#define MOVINGOBJECT_H

#include "object.h"
#include <cmath>

class MovingObject : public Object
{


protected:


  QVector2D    m_velocity;    // wektor predkosci
  QVector2D    m_heading;     //znormalizowany wektor kierunku
  double       m_maxSpeed;  //maksymalna predkosc poruszania
  double       m_maxTurnRate;// maksymalny oborot (radian/jednostke czasu)



public:

  MovingObject();
  virtual ~MovingObject(){}


  const QVector2D&   velocity()const;
  void      setVelocity(const QVector2D&);
  const QVector2D&   heading()const;
  void      setHeading(const QVector2D&);
  bool      rotateToTarget(const QVector2D&);
  QVector2D rotate(const QVector2D&, double)const;
  inline double    maxSpeed()const;
  void      setMaxSpeed(double);
  inline bool      isSpeedMaxedOut()const;
  inline double    speed()const;
  inline double    speedSquared()const;
  inline double    maxTurnRate()const;
  void      setMaxTurnRate(double);


};

#endif // MOVINGOBJECT_H
